<?php 
$webroot="";
if(session::is_manager()==TRUE)
{
	require_once 'html/admintemplate.php';
}
else 
{
	require_once 'html/template.php';
}

?>
<table border=1 width="100%">
  <tr class="classmenu">
    <td colspan=4>
    Tickets
    </td>
  </tr>
  <tr class="classtopmenu">
    <td >
    Id
    </td>
     <td >
   Date
    </td>
     <td >
  Subject
    </td>
     <td >
  Status
    </td>
  </tr>

<?php
if(empty($GetTickets))
{
	echo "<tr><td>
	You do not have any ticket for viewing
	</td></tr>";
}
else 
{
	foreach($GetTickets as $ShowTicket)
	{
		?>
		<tr>
		<td>
		<a href="viewticketsdetail.php?ticketid=<?php echo $ShowTicket['ticketid'];?>&userid=<?php echo $ShowTicket['userid'];?>" >View</a>
		<?php echo $ShowTicket['ticketid'];?>
		</td>
		<td>
			<?php echo $ShowTicket['date'];?>
		</td>
		<td>
			<?php echo $ShowTicket['subject'];?>
		</td>
		<td>
			<?php if($ShowTicket['closed']==1)
			{
				echo "Closed";
			}
			else 
			{
				echo "Open";
			}
			?>
		</td>
		</tr>
		<?php 
	}
}
?>

</table>